﻿using System;

namespace Earthwatchers.Models
{
    public class Land
    {
        public Land()
        {
            StatusChangedDateTime = DateTime.Now;
        }

        private string baseUri = @"land/{0}";
        public int Id { get; set; }
        public double Latitude { get; set; }
        public double Longitude { get; set; }
        public string GeohexKey { get; set; }
        public LandThreat LandThreat { get; set; }
        public LandStatus LandStatus { get; set; }
        public int? EarthwatcherId { get; set; }
        public string DeforestationConfirmers { get; set; }
        public string DeforestationDeconfirmers { get; set; }
        public DateTime StatusChangedDateTime { get; set; }

        public string Uri
        {
            get { return String.Format(baseUri, Id); }
            set { baseUri = value; }
        }

        public bool HasOwner 
        {
            get { return (EarthwatcherId != null); }
        }
    }
}
